Skip to content

refactor(eql-bindings)!: name a target's plaintext with ValueKind; keep the Go guest's frame parse in one helper - #1995

Merged
coderdan merged 4 commits into
nextfrom
refactor/bindings-drop-workarounds
Nov 27, 2026
Merged

coderdan merged 4 commits into
nextfrom
refactor/bindings-drop-workarounds

Conversation

@coderdan

Copy link
Copy Markdown
Contributor

Summary

The last part of stage 2 that this branch can do. EQL's target table names each target's plaintext with ValueKind, the one shared type, instead of its own string. The Go guest keeps its frame parse, now in one helper, with a comment that says why. A new Go guest test stores, queries and reads a UUID field.

Closes #1992. Refs #1821, #1831.

Changes

  1. EQL (eql-bindings, eql-codegen): Target::plaintext is an Option<ValueKind> instead of an Option<&'static str>, and Target::plaintext_kind() is removed, because the field now holds what it returned.
    • The se_targets wire format is unchanged: it still writes the kind's name.
    • The generated table writes Some(ValueKind::Int32) and so on.
    • The Go table, eql_gen.go, does not change.
    • eql-codegen gains a path dependency on vitaminc-aead.
  2. Go guest: checked_plaintext and parse_frame in guest/src/ops.rs were identical and are now one parse_frame. The parse stays. Frame::parse is the only way to build a Frame from the host's bytes, and the engine's readers take a Frame. It also gives the Go SDK its "an input is not a value in the transport frame" error before any key is requested.
  3. UUID test: a_uuid_field_round_trips_and_queries_by_equality in guest/tests/native_ops.rs. It writes a UUID field and reads it back. An eq query matches the stored term, and a different UUID does not.
  4. Plan: step 2.6 records what was done, and what the plan had wrong.

What the plan had wrong

UUID per SDK (#1821 stays open)

SDK Stores, queries and reads a UUID Evidence
Rust (dynamic::record) Yes a_uuid_field_is_sealed_and_indexed_for_equality
Go guest Yes the new test, under all four feature sets
Go generated code No: stashgen maps no Go type to a UUID #1994
TypeScript Not on next, which encrypts strings only #1775 and #1776 need a UUID test once they drop is_uuid

Verification

  • Root workspace: cargo fmt --check and clippy with -D warnings pass. stack-encrypt tests: 1699 passed, pinned fixtures unchanged.
  • Go guest: fmt, tests and clippy with each of its four feature sets, and rustdoc public and private.
  • Go module: with all five WASI guests built, go test ./... with STACK_CONFORMANCE_REQUIRED=1 passes in all three modules. go vet and gofmt are clean.
  • EQL:
    • clippy on four crates;
    • tests for eql-codegen, eql-domains, eql-bindings (all features) and the encryption tests;
    • the types:generate and types:check task bodies, with types:check passing on the committed tree;
    • eql-bindings rustdoc for three feature sets, public and private.
  • recipher-js: clippy and 51 tests.
  • Not run: TypeScript vitest and the script tests (no node_modules in the worktree), and the EQL sqlx crate, which needs its generated fixtures.
  • cargo doc -p eql-codegen with -D warnings fails on lines this branch does not touch. CI does not build it.

Review notes

  • Breaking, unreleased: Target has not been released, so this is not a break for users. The pending .changeset/eql-plan-field-targets.md already says the table has "the plaintext ValueKind it takes", which is now exactly true. No changeset was added. The eql-bindings CHANGELOG has an Unreleased bullet.
  • No stack-encrypt lines changed, so the mutation gate has nothing to mutate.

…st a uuid field

The engine's readers take a Frame, and Frame::parse is the only way to
make one from the host's bytes, so the guest's parse is not a second
check of what the engine checks. It is also what gives the Go SDK its
"not a frame" error, the same on every path and before any key request.
checked_plaintext and parse_frame were the same function under two names;
they are now one, with a comment that says why the parse stays.

A new guest test stores a uuid field through the record exports, opens
it, and derives an eq query that matches the stored term only for the
same UUID, so the guest holds a UUID end to end.
The target table recorded each type's plaintext as text ("int32"), and
eql-codegen held its own list of those names, a copy that could drift
from the engine's. Target::plaintext is now an Option<ValueKind>, the
generated table writes ValueKind::Int32 and so on, and eql-codegen's
plaintext_of returns a ValueKind, so a wrong name no longer compiles.
Target::plaintext_kind, which parsed the text, is removed.

The se_targets wire format still writes the kind's name, and the Go
table is unchanged (it writes ValueKind::name). Target is not released
yet, so the break is in the unreleased changelog entry.
The TypeScript workarounds the step names are not on next: is_uuid and
the uuid module live on the values and records branches, and OneValue
stays because the addon's string-only encrypt needs a Scalar. The Go
guest's Frame::parse is the only way to make a Frame from host bytes,
so it stays. EQL names a target's plaintext with ValueKind. A UUID
works in Rust and the Go guest; stashgen and the addon cannot express
one yet, so #1821 stays open.
@coderabbitai

coderabbitai Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI; Enforced overrides: Organization
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4871ed35-db2f-4b3b-b0fc-908ba510ab17

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

@changeset-bot

changeset-bot Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 8900d02

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderdan coderdan left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Human pass. LGTM.

@cipherstash-agent cipherstash-agent left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review attestation

Reviewed ac3c914c · posted from Claude Code (scheduled routine) · claude-opus-5-5 · code-review effort medium
Sources: code-review · claude-opus-5-5; mattpocock-skills:code-review (Standards and Spec sub-agents) · claude-opus-5-5; company-skills:rust-security · claude-opus-5-5
Skills: code-review, company-skills:rust-security, mattpocock-skills:code-review, company-skills:review-cross-check, company-skills:review-post

Findings (3): 3 minor — 3 inline, 0 below.

Verified against the head and cross-checked against existing feedback. Five other candidates were refuted at head and are not posted: a missing changeset (Target is unreleased; .changeset/eql-plan-field-targets.md covers it), the format_ident!("{kind:?}") coupling (derived Debug; any break fails to compile), the document_row .expect (the one catalog name parses, and eql-domains must stay dependency-free), a vacuous assertion in tests/encryption/tests/targets.rs:530, and stashgen UUID support (moved to #1994 by the issue's scope comment). rust-security found nothing: no secret handling changed, and the merged parse_frame reads the same Protected bytes.

Not run by this review: the Go guest tests, mise run types:check, and the TypeScript suites. cargo test -p eql-codegen passed apart from 2 tests that fail when run as root; the generated v4/targets.rs matches what the codegen renders.


Generated by Claude Code

… test helpers

- `parse_frame`'s doc said every malformed input is reported as "not a
  frame". Query statistics, the options and the keyset selector have
  their own readers, which refuse malformed bytes with their own errors.
  The doc now says it covers a plan, a context and a value.
- The UUID test read the query's term by hand. It uses the file's
  `query_term_entries`, `entry` and `bytes_of`, as the other tests do.
- `eql-codegen`'s path dependency on `vitaminc-aead` names its version,
  as every other dependency on that crate does.
@coderdan
coderdan merged commit 9cd9c1c into next Nov 27, 2026
40 checks passed
@coderdan
coderdan deleted the refactor/bindings-drop-workarounds branch November 27, 2026 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bindings: remove the TypeScript, Go and EQL workarounds for the engine, so every SDK can store a UUID

2 participants